<div class="bg-light lter b-b wrapper-md">
  <h1 class="m-n font-thin h3">运营管理</h1>
</div>

<div class="wrapper-md">
  <div class="panel panel-default">
    <div class="panel-heading">
      广告管理
    </div>
    <toaster-container toaster-options="{'position-class': 'toast-center', 'close-button':true}"></toaster-container>
    <div class="panel-body b-b b-light">
      <p>
        广告类别: <select class="form-control forminfo inline w-sm" name="RepaymentTypeID" ng-model="AdData.AdTypeId">
                    <option value="">全部</option>
                    <option value="1">首页banner</option>
                    <option value="2">APP弹框广告</option>
                    <option value="3">APP更多页面Banner</option>
                    <option value="4">APP我的页面</option>
                    <option value="5">热门活动</option>
                  </select>
        广告标题: <input id="filter" type="text" ng-model="AdData.AdTitle" class="form-control input-sm w-sm inline m-r">
        <button class="btn btn-info btn-addon" ng-if='!graybtn' ng-click="queryAd()">查询</button>
        <button class="btn btn-light btn-addon" ng-if='graybtn'>查询</button>
        </p>
        <p>
            <a class="btn btn-info btn-addon" ng-click="addAd()">添加</a>
            <a class="btn btn-info btn-addon" ng-click='sortAd()'>排序</a>
            <a class="btn btn-info btn-addon" ng-click='deleteCache()'>删除缓存</a>
        </p>            
    </div>
    <div class="table-responsive">
      <table id="tab" class="table table-striped m-b-none">
        <thead>
          <tr>
            <th style="width:10%">排序</th>
            <th style="width:15%">广告类型</th>
            <th style="width:15%">广告标题</th>
            <th style="width:10%">广告图片</th>
            <th style="width:10%">链接</th>
            <th style="width:10%">开始时间</th>
            <th style="width:10%">结束时间</th>
            <th style="width:15%">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-if="AdList==''"><td colspan="9">当前无任何数据</td></tr>
          <tr ng-repeat="obj in AdList">
            <td ng-bind="obj.AdSort"></td>
            <td ng-bind="obj.AdTypeId==1?'首页banner':obj.AdTypeId==2?'APP弹框广告':obj.AdTypeId==3?'APP更多页面Banner':obj.AdTypeId==4?'APP我的页面':obj.AdTypeId==5?'热门活动':'未知类型'"></td>
            <td ng-bind="obj.AdTitle"></td>
            <td><img style="width: 100px" ng-src="{{imgurl+obj.AdImage}}"></td>
            <td ng-bind="obj.AdUrl"></td>
            <td ng-bind="obj.StartTime|date:'yy-MM-dd'"></td>
            <td ng-bind="obj.EndTime|date:'yy-MM-dd'"></td>
            <td><button class="btn m-b-xs btn-sm btn-info" style="margin-right:10px;" ng-click="editAd(obj)">编辑</button><button class="btn m-b-xs btn-sm btn-info" style="margin-right:10px;" ng-click="deleteAd(obj.Id)">删除</button> </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
  <div class="btn-group pull-right">
    <button type="button" class="btn btn-default" ng-click="prev()"><font><font>上一页</font></font></button>
    <button type="button" class="btn btn-default btnNum">{{AdData.Index}}</button>
    <button type="button" class="btn btn-default" ng-click="next()"><font><font>下一页</font></font></button>
    <span class="btn btn-default">共<span ng-bind="QueryListTotal+'条数据'"></span></span>
  </div>